﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="studentManage.aspx.cs" Inherits="学生成绩查询及选课系统.admin.studentManage" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>学生成绩查询及选课系统</title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" href="../css/font.css"/>
    <link rel="stylesheet" href="../css/xadmin.css"/>
    <link href="./StyleSheet1.css" rel="stylesheet" />
    <!-- <link rel="stylesheet" href="./css/theme5.css"> -->
    <script src="../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../js/xadmin.js"></script>

</head>
<body>
   <div>
        <form id="form1" runat="server">
        <div style="font-size:20px; height: 395px;">
    
            <div>
                <br />
                学号:<asp:TextBox ID="TextBox1" runat="server" CssClass="layui-input-inline"></asp:TextBox>
&nbsp;
                <asp:Button ID="Button1" runat="server" Text="查找" Width="70px" CssClass="layui-btn" OnClick="Button1_Click" />
                <br />

            </div>
            <br />
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="stuno" DataSourceID="SqlDataSource2" CellPadding="4" ForeColor="#333333" GridLines="None" Height="16px" OnRowCommand="GridView1_RowCommand">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="stuno" HeaderText="学号" InsertVisible="False" ReadOnly="True" SortExpression="stuno" />
                <asp:BoundField DataField="stuname" HeaderText="姓名" SortExpression="stuname" />
                <asp:BoundField DataField="stugender" HeaderText="性别" SortExpression="stugender" />
                <asp:BoundField DataField="stuage" HeaderText="年龄" SortExpression="stuage" />
                <asp:BoundField DataField="classno" HeaderText="班级号" SortExpression="classno" />
                <asp:BoundField DataField="stustate" HeaderText="就读状态" SortExpression="stustate" />
                <asp:CommandField ShowEditButton="True" />
                <asp:ButtonField CommandName="Insert" Text="添加" />
            </Columns>
            <EditRowStyle BackColor="#7C6F57" />
            <EmptyDataTemplate>
                <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="stuno" DataSourceID="SqlDataSource2" Height="63px" Width="344px" DefaultMode="Insert" OnItemInserted="DetailsView1_ItemInserted" CellPadding="4" ForeColor="#333333" GridLines="None" OnItemCommand="DetailsView1_ItemCommand" >
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
                    <EditRowStyle BackColor="#999999" />
                    <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" />
                    <Fields>
                        <asp:BoundField DataField="stuno" HeaderText="学号" InsertVisible="False" ReadOnly="True" SortExpression="stuno" />
                        <asp:BoundField DataField="stuname" HeaderText="姓名" SortExpression="stuname" />
                        <asp:BoundField DataField="stugender" HeaderText="性别" SortExpression="stugender" />
                        <asp:BoundField DataField="stuage" HeaderText="年龄" SortExpression="stuage" />
                        <asp:BoundField DataField="classno" HeaderText="班级号" SortExpression="classno" />
                        <asp:BoundField DataField="stustate" HeaderText="就读状态" SortExpression="stustate" />
                        <asp:CommandField ShowInsertButton="True" />
                    </Fields>
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                </asp:DetailsView>
            </EmptyDataTemplate>
            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#E3EAEB" />
            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333"  />
            <SortedAscendingCellStyle BackColor="#F8FAFA" />
            <SortedAscendingHeaderStyle BackColor="#246B61" />
            <SortedDescendingCellStyle BackColor="#D4DFE1" />
            <SortedDescendingHeaderStyle BackColor="#15524A" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:C#StuentManageConnectionString %>" DeleteCommand="DELETE FROM [student] WHERE [stuno] = @stuno" InsertCommand="INSERT INTO [student] ([stuname], [stugender], [stuage], [classno], [stustate]) VALUES (@stuname, @stugender, @stuage, @classno, @stustate)" SelectCommand="SELECT * FROM [student]" UpdateCommand="UPDATE [student] SET [stuname] = @stuname, [stugender] = @stugender, [stuage] = @stuage, [classno] = @classno, [stustate] = @stustate WHERE [stuno] = @stuno">
            <DeleteParameters>
                <asp:Parameter Name="stuno" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="stuname" Type="String" />
                <asp:Parameter Name="stugender" Type="Int32" />
                <asp:Parameter Name="stuage" Type="Int32" />
                <asp:Parameter Name="classno" Type="String" />
                <asp:Parameter Name="stustate" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="stuname" Type="String" />
                <asp:Parameter Name="stugender" Type="Int32" />
                <asp:Parameter Name="stuage" Type="Int32" />
                <asp:Parameter Name="classno" Type="String" />
                <asp:Parameter Name="stustate" Type="String" />
                <asp:Parameter Name="stuno" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
   </div>
        
         </form>
   </div>
</body>
</html>
